package com.js.admin.mapper;

import com.js.admin.entity.BaseAppOrder;
import com.js.common.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author： ygl
 * @date： 2018/11/01-16:14
 * @Description：
*/
public interface BaseAppOrderMapper extends BaseMapper<BaseAppOrder> {
    /**
     * 查询租户是否购买应用
     * @param tenantId
     * @param clientId
     * @return
     */
    @Select("select * from base_app_order where app_id in " +
            " (select id from base_application where code = #{clientId}) " +
            " and tenant_id = #{tenantId}")
    BaseAppOrder selectAppOrderByClientId(@Param("tenantId") String tenantId, @Param("clientId")String clientId);
}